$LOAD_PATH.unshift File.join(File.dirname(__FILE__),'../..','ext_pr1/lib')
require 'ext_pr1_v4'

# Volumenberechnung für Zylinder
# v_Zylinder ::= (r, h) ::
#    float x float =>? float::::(r>=0.0 and h>=0.0)
# Formel: g * h
#         g = r * pi ^ 2
# Testfälle
# r    h     v
# 0,0  0,0   0,0
# 0,0  1,0   0,0
# 1,0  0,0   0,0
# 3,0  2,0   59,2176264
# 3,0  3,0   88,8264396
# 2,0  3,0   59,2176264
# 5,0  8,0   394,784176
# -,2  1,0   err
# 1,0  -,2   err

def v_zylinder(r, h)
   check_pre(((r.float?) and (h.float?) and (r >= 0.0) and (h >= 0.0)))
   h * r * ( Math::PI ** 2 )
end
